package edu.uow.devdocs

class AssignmentStatus {
	String status
	Boolean activeFlag = true
	
	static mapping = {
		id generator: 'sequence', params:[sequence:'STATUS_SEQ']
		version false
		sort status:'ASC'
		cache usage: 'read-only'
	}
	
    static constraints = {
		status(nullable:false, unique: true)
		activeFlag(nullable:false)
    }
	
	String toString() {
		return "${status}"
	}
	
	static AssignmentStatus getNewStatus() {
		return AssignmentStatus.findByStatus('New', [cache: true])
	}
	
	static AssignmentStatus getOpenStatus() {
		return AssignmentStatus.findByStatus('Open',[cache: true])
	}

	
}
